//
//  MenuTableViewCell.m
//  土巴兔
//
//  Created by 千锋 on 15/12/29.
//  Copyright (c) 2015年 IOS1503薛凯. All rights reserved.
//

#import "MenuTableViewCell.h"
#import "Default.h"
@implementation MenuTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self=[super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self createUI];
    }
    return self;
}
- (void)createUI{
    _scrollview=[[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, DEVICEWIDTH, DEVICEHEIGHT/3)];
    _scrollview.contentSize=CGSizeMake(DEVICEWIDTH*2, DEVICEHEIGHT/3);
    [self.contentView addSubview:_scrollview];
    _scrollview.showsHorizontalScrollIndicator=NO;
    _scrollview.pagingEnabled=YES;
    //1.户型设计报价
    _huxingshejibaojia=[[UIButton alloc] init];
    _huxingshejibaojia.frame=CGRectMake(0, 0, DEVICEWIDTH/4, DEVICEHEIGHT/6);
    [_huxingshejibaojia setImage:[UIImage imageNamed:@"home_shejibaojia"] forState:UIControlStateNormal];
    _huxingshejibaojia.imageEdgeInsets=UIEdgeInsetsMake(-5, 13, 20, 0);
    [_huxingshejibaojia setTitle:@"户型设计报价" forState:UIControlStateNormal];
    _huxingshejibaojia.titleLabel.font=[UIFont systemFontOfSize:12];
    [_huxingshejibaojia setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    _huxingshejibaojia.titleEdgeInsets=UIEdgeInsetsMake(40, -48, -10, 0);
    [_scrollview addSubview:_huxingshejibaojia];
    _huxingshejibaojia.tag=1001;
    [_huxingshejibaojia addTarget:self.delegate action:@selector(pressMenuCellButton:) forControlEvents:UIControlEventTouchUpInside];
    //2.装修保
    _zhuangxiubao=[[UIButton alloc] init];
    _zhuangxiubao.frame=CGRectMake(DEVICEWIDTH/4, 0, DEVICEWIDTH/4, DEVICEHEIGHT/6);
    [_zhuangxiubao setImage:[UIImage imageNamed:@"home_zhuangxiubao"] forState:UIControlStateNormal];
    _zhuangxiubao.imageEdgeInsets=UIEdgeInsetsMake(-5, 13, 20, 0);
    [_zhuangxiubao setTitle:@"装修保" forState:UIControlStateNormal];
    _zhuangxiubao.titleLabel.font=[UIFont systemFontOfSize:12];
    [_zhuangxiubao setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    _zhuangxiubao.titleEdgeInsets=UIEdgeInsetsMake(40, -48, -10, 0);
    [_scrollview addSubview:_zhuangxiubao];
    _zhuangxiubao.tag=1002;
    [_zhuangxiubao addTarget:self.delegate action:@selector(pressMenuCellButton:) forControlEvents:UIControlEventTouchUpInside];
    //3.智能报价
    _zhinengbaojia=[[UIButton alloc] init];
    _zhinengbaojia.frame=CGRectMake(DEVICEWIDTH/4*2, 0, DEVICEWIDTH/4, DEVICEHEIGHT/6);
    [_zhinengbaojia setImage:[UIImage imageNamed:@"home_baojia"] forState:UIControlStateNormal];
    _zhinengbaojia.imageEdgeInsets=UIEdgeInsetsMake(-5, 13, 20, 0);

    [_zhinengbaojia setTitle:@"智能报价" forState:UIControlStateNormal];
    _zhinengbaojia.titleLabel.font=[UIFont systemFontOfSize:12];
    [_zhinengbaojia setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    _zhinengbaojia.titleEdgeInsets=UIEdgeInsetsMake(40, -48, -10, 0);
    [_scrollview addSubview:_zhinengbaojia];
    _zhinengbaojia.tag=1003;
    [_zhinengbaojia addTarget:self.delegate action:@selector(pressMenuCellButton:) forControlEvents:UIControlEventTouchUpInside];
    //4.免费验房
    _mianfeiyanfang=[[UIButton alloc] init];
    _mianfeiyanfang.frame=CGRectMake(DEVICEWIDTH/4*3, 0, DEVICEWIDTH/4, DEVICEHEIGHT/6);
    [_mianfeiyanfang setImage:[UIImage imageNamed:@"home_yanfang"] forState:UIControlStateNormal];
    _mianfeiyanfang.imageEdgeInsets=UIEdgeInsetsMake(-5, 13, 20, 0);
    
    [_mianfeiyanfang setTitle:@"免费验房" forState:UIControlStateNormal];
    _mianfeiyanfang.titleLabel.font=[UIFont systemFontOfSize:12];
    [_mianfeiyanfang setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    _mianfeiyanfang.titleEdgeInsets=UIEdgeInsetsMake(40, -48, -10, 0);
    [_scrollview addSubview:_mianfeiyanfang];
    _mianfeiyanfang.tag=1004;
    [_mianfeiyanfang addTarget:self.delegate action:@selector(pressMenuCellButton:) forControlEvents:UIControlEventTouchUpInside];
    //5.装修攻略
    _zhuangxiugonglue=[[UIButton alloc] init];
    _zhuangxiugonglue.frame=CGRectMake(0, DEVICEHEIGHT/6, DEVICEWIDTH/4, DEVICEHEIGHT/6);
    [_zhuangxiugonglue setImage:[UIImage imageNamed:@"home_gonglue"] forState:UIControlStateNormal];
    _zhuangxiugonglue.imageEdgeInsets=UIEdgeInsetsMake(-5, 13, 20, 0);
    
    [_zhuangxiugonglue setTitle:@"装修攻略" forState:UIControlStateNormal];
    _zhuangxiugonglue.titleLabel.font=[UIFont systemFontOfSize:12];
    [_zhuangxiugonglue setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    _zhuangxiugonglue.titleEdgeInsets=UIEdgeInsetsMake(40, -48, -10, 0);
    [_scrollview addSubview:_zhuangxiugonglue];
    _zhuangxiugonglue.tag=1005;
    [_zhuangxiugonglue addTarget:self.delegate action:@selector(pressMenuCellButton:) forControlEvents:UIControlEventTouchUpInside];
    //6.精品专题
    _jingpinzhuanti=[[UIButton alloc] init];
    _jingpinzhuanti.frame=CGRectMake(DEVICEWIDTH/4, DEVICEHEIGHT/6, DEVICEWIDTH/4, DEVICEHEIGHT/6);
    [_jingpinzhuanti setImage:[UIImage imageNamed:@"home_zhuangti"] forState:UIControlStateNormal];
    _jingpinzhuanti.imageEdgeInsets=UIEdgeInsetsMake(-5, 13, 20, 0);
    [_jingpinzhuanti setTitle:@"精品专题" forState:UIControlStateNormal];
    _jingpinzhuanti.titleLabel.font=[UIFont systemFontOfSize:12];
    [_jingpinzhuanti setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    _jingpinzhuanti.titleEdgeInsets=UIEdgeInsetsMake(40, -48, -10, 0);
    [_scrollview addSubview:_jingpinzhuanti];
    _jingpinzhuanti.tag=1006;
    [_jingpinzhuanti addTarget:self.delegate action:@selector(pressMenuCellButton:) forControlEvents:UIControlEventTouchUpInside];
    //7.装修公司
    _zhuangxiugongsi=[[UIButton alloc] init];
    _zhuangxiugongsi.frame=CGRectMake(DEVICEWIDTH/4*2, DEVICEHEIGHT/6, DEVICEWIDTH/4, DEVICEHEIGHT/6);
    [_zhuangxiugongsi setImage:[UIImage imageNamed:@"home_gongshi"] forState:UIControlStateNormal];
    _zhuangxiugongsi.imageEdgeInsets=UIEdgeInsetsMake(-5, 13, 20, 0);
    [_zhuangxiugongsi setTitle:@"装修公司" forState:UIControlStateNormal];
    _zhuangxiugongsi.titleLabel.font=[UIFont systemFontOfSize:12];
    [_zhuangxiugongsi setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    _zhuangxiugongsi.titleEdgeInsets=UIEdgeInsetsMake(40, -48, -10, 0);
    [_scrollview addSubview:_zhuangxiugongsi];
    _zhuangxiugongsi.tag=1007;
    [_zhuangxiugongsi addTarget:self.delegate action:@selector(pressMenuCellButton:) forControlEvents:UIControlEventTouchUpInside];
    //8.官方客服
    _guanfangkefu=[[UIButton alloc] init];
    _guanfangkefu.frame=CGRectMake(DEVICEWIDTH/4*3, DEVICEHEIGHT/6, DEVICEWIDTH/4, DEVICEHEIGHT/6);
    [_guanfangkefu setImage:[UIImage imageNamed:@"home_dianhua"] forState:UIControlStateNormal];
    _guanfangkefu.imageEdgeInsets=UIEdgeInsetsMake(-5, 13, 20, 0);
    [_guanfangkefu setTitle:@"官方客服" forState:UIControlStateNormal];
    _guanfangkefu.titleLabel.font=[UIFont systemFontOfSize:12];
    [_guanfangkefu setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    _guanfangkefu.titleEdgeInsets=UIEdgeInsetsMake(40, -48, -10, 0);
    [_scrollview addSubview:_guanfangkefu];
    _guanfangkefu.tag=1008;
    [_guanfangkefu addTarget:self.delegate action:@selector(pressMenuCellButton:) forControlEvents:UIControlEventTouchUpInside];
    //9.装修黄历
    _zhuangxiuhangli=[[UIButton alloc] init];
    _zhuangxiuhangli.frame=CGRectMake(DEVICEWIDTH/4*4, 0, DEVICEWIDTH/4, DEVICEHEIGHT/6);
    [_zhuangxiuhangli setImage:[UIImage imageNamed:@"home_rili"] forState:UIControlStateNormal];
    _zhuangxiuhangli.imageEdgeInsets=UIEdgeInsetsMake(-5, 13, 20, 0);
    [_zhuangxiuhangli setTitle:@"装修黄历" forState:UIControlStateNormal];
    _zhuangxiuhangli.titleLabel.font=[UIFont systemFontOfSize:12];
    [_zhuangxiuhangli setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    _zhuangxiuhangli.titleEdgeInsets=UIEdgeInsetsMake(40, -48, -10, 0);
    [_scrollview addSubview:_zhuangxiuhangli];
    _zhuangxiuhangli.tag=1009;
    [_zhuangxiuhangli addTarget:self.delegate action:@selector(pressMenuCellButton:) forControlEvents:UIControlEventTouchUpInside];
    //10.装修计算器
    _zhuangxiujisuanqi=[[UIButton alloc] init];
    _zhuangxiujisuanqi.frame=CGRectMake(DEVICEWIDTH/4*5, 0, DEVICEWIDTH/4, DEVICEHEIGHT/6);
    [_zhuangxiujisuanqi setImage:[UIImage imageNamed:@"home_jisuangqi"] forState:UIControlStateNormal];
    _zhuangxiujisuanqi.imageEdgeInsets=UIEdgeInsetsMake(-5, 13, 20, 0);
    [_zhuangxiujisuanqi setTitle:@"装修计算器" forState:UIControlStateNormal];
    _zhuangxiujisuanqi.titleLabel.font=[UIFont systemFontOfSize:12];
    [_zhuangxiujisuanqi setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    _zhuangxiujisuanqi.titleEdgeInsets=UIEdgeInsetsMake(40, -48, -10, 0);
    [_scrollview addSubview:_zhuangxiujisuanqi];
    _zhuangxiujisuanqi.tag=1010;
    [_zhuangxiujisuanqi addTarget:self.delegate action:@selector(pressMenuCellButton:) forControlEvents:UIControlEventTouchUpInside];
}
@end
